<template>
  <div>
    <column-list :list="list"></column-list>
  </div>
</template>

<script lang="ts">
import { defineComponent, computed, onMounted } from "vue";
import { useStore } from "vuex";
import ColumnList from "../components/ColumnList.vue";
import { testData } from "../testData";
import { GlobalDataProps } from "../store";
import store from "../store";

export default defineComponent({
  name: "Home",
  components: {
    ColumnList
  },
  setup() {
    const store = useStore<GlobalDataProps>();
    const list = computed(() => store.state.columns);
    const biggerColumnLen = computed(() => store.getters.biggerColumnsLen);
    onMounted(() => {
      store.dispatch("fetchColumns");
    });
    return { list, biggerColumnLen };
  }
});
</script>

<style scoped></style>
